<template>
    <view class="count" :class="size">
        <!-- @click.stop="stopFunc" -->
     
        <view class="btn-cont" >

            <text class="nums"  v-if="numVal && numVal > 0" >
                {{numVal}}
            </text>

            <text class="" >
                选规格
            </text>
              
            
        </view>
    </view>
</template>

<script>

export default {
    props:{
        numVal:{
            type:[Number,String],
            default:0
        },
        size:String,
        parameter:[Number,String,Object,Array]
    },
    components: {},
    data () {
        return {
            num:0
        }
    },

    methods: {
        initData () {


        },
        countFunc( e  ) {

            let num = this.numVal + e
           
            this.$emit('update:numVal', num )

            // this.$emit('change', num ,this.parameter ,e)
            
		},
        stopFunc(){
            this.$emit('handleClick')
        }
    }
}
</script>

<style scoped lang="scss">
.count{
    display: inline-block;
    text-align: center;
    .btn-cont{
        position: relative;
        height: 40rpx;
        text-align: center;
        line-height: 40rpx;
        color: #000;
        border-radius: 4px;
        // background: #313138;
        background-color: rgb(255, 204, 77);
        font-size: 22rpx;
        padding: 0 10rpx;
        font-weight: bold;
        .nums{

            position: absolute;
            right: -10rpx;
            top: -20rpx;
            width: 32rpx;
            height: 32rpx;
            line-height: 32rpx;
            background-color: #f1492b ;
            color: #fff;
            font-weight: bolder;
            font-size: 22rpx;
            border-radius: 50%;
        }
    }
    .box{
        display: flex;
        align-items: center;
        justify-content: space-between;
        .nums{
            text-align: center;
            min-width: 60rpx;
            color: #000;
            font-size: 26rpx;
        }
    }
    &.big{
        .box{
           
            .nums{
                min-width: 80rpx;
                font-size: 34rpx;
            }
        }
    }
}
</style>
